// DlgChangePwd.cpp : implementation file
//

#include "stdafx.h"
#include "Celsus.h"
#include "DlgChangePwd.h"


// CDlgChangePwd dialog

IMPLEMENT_DYNAMIC(CDlgChangePwd, CDialog)

CDlgChangePwd::CDlgChangePwd(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgChangePwd::IDD, pParent)
	, m_szPassword(_T(""))
	, m_szConfirm(_T(""))
{

}

CDlgChangePwd::~CDlgChangePwd()
{
}

void CDlgChangePwd::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT_PASSWORD, m_szPassword);
	DDX_Text(pDX, IDC_EDIT_CONFIRM, m_szConfirm);
}


BEGIN_MESSAGE_MAP(CDlgChangePwd, CDialog)
END_MESSAGE_MAP()


// CDlgChangePwd message handlers

BOOL CDlgChangePwd::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgChangePwd::OnOK()
{
	// update data
	UpdateData();
	// check password match
	if( m_szPassword != m_szConfirm )
	{
		AfxMessageBox( IDS_ERROR_PASSWORD_CONFIRM, MB_ICONSTOP );
		return;
	}

	CDialog::OnOK();
}
